<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>from</title>
    <link rel="stylesheet" type="text/css" href="/easyui.css">
    <link rel="stylesheet" type="text/css" href="/icon.css">
    <link rel="stylesheet" type="text/css" href="/demo.css">
    <script src="/jquery.min.js"></script>
    <script src="/jquery.easyui.min.js"></script>
</head>
<body>
<h2>Basic Form</h2>
<p>Fill the form and submit it.</p>
<div style="margin:20px 0;"></div>
<form id="ff">
    <div>
        <label >Name:</label>
        <input class="easyui-validatebox" type="text" name="name" data-options="required:true" />
    </div>
    <div>
        <label >Email:</label>
        <input class="easyui-validatebox" type="password" name="password" data-options="required:true" />
    </div>
    <input type="submit" value="提交" >

</form>
<script type="text/javascript">
    $("#ff").form({

    });
    $("#ff").form('submit',{
            url:"/day11/form",
        onSubmit: function(){
        // do some check
        // return false to prevent submit;
    },
    success:function(data){
        alert(typeof data);
        var json = eval('(' + data + ')');
        console.log(json.name);
        console.log(json.password);
    }

    })
</script>
</body>

</html>